package com.wunong.smart.commission.domain.state.operation;

import com.wunong.smart.commission.application.context.CommissionContext;
import com.wunong.smart.commission.application.request.BaseCommissionRequest;
import com.wunong.smart.commission.client.enums.CommissionOperationEnum;
import com.wunong.smart.domain.platform.common.VerifyDTO;

/**
 * @author create by zealot.zt
 */
public interface CommissionOperation<REQ extends BaseCommissionRequest> {

    /**
     * 执行对应操作
     *
     * @param context
     * @return
     */
    Object operate(CommissionContext<REQ> context);

    /**
     * 能否执行对应的操作
     *
     * @param context
     * @return
     */
    default VerifyDTO canOperate(CommissionContext<REQ> context) {
        return VerifyDTO.available();
    }

    /**
     * 获取对应的操作枚举
     *
     * @return
     */
    CommissionOperationEnum getOperationEnum();

}
